package com.zjw.zy.bean;

import android.os.Parcel;
import android.os.Parcelable;

import com.google.gson.annotations.SerializedName;

import java.util.Date;

/**
 * @author ：zhong.jw
 * @date ：Created in 2022/9/27 17:18
 */
public final class DailyWeather implements Parcelable {
    @SerializedName("text_day")
    public String textDay;
    @SerializedName("code_day")
    public String codeDay;
    @SerializedName("text_night")
    public String textNight;
    @SerializedName("code_night")
    public String codeNight;
    //日最高气温 ℃
    @SerializedName("high")
    public int high;
    //日最低气温 ℃
    @SerializedName("low")
    public int low;
    //白天风力级别
    @SerializedName("wc_day")
    public String wcDay;
    //白天风向 西南风
    @SerializedName("wd_day")
    public String wdDay;
    //黑夜风力级别
    @SerializedName("wc_night")
    public String wcNight;
    //黑夜风向
    @SerializedName("wd_night")
    public String wdNight;
    //白天风向角度 °
    @SerializedName("wa_day")
    public String waDay;
    //黑夜风向角度 °
    @SerializedName("wa_night")
    public String waNight;
    //白天风速 m/s
    @SerializedName("ws_day")
    public String wsDay;
    //黑夜风速 m/s
    @SerializedName("ws_night")
    public String wsNight;
    //降雨概率 %
    @SerializedName("pop")
    public int pop;
    //气压 hPa
    @SerializedName("pressure")
    public int pressure;
    //最大相对湿度 %
    @SerializedName("maxrh")
    public int maxRh;
    //最小相对湿度 %
    @SerializedName("minrh")
    public int minRh;
    //能见度 m
    @SerializedName("vis")
    public int vis;
    //白天云量 %
    @SerializedName("clouds_day")
    public int cloudsDay;
    @SerializedName("clouds_night")
    public int cloudsNight;
    //紫外线强度
    @SerializedName("uv")
    public int uv;
    //预报日期
    @SerializedName("date")
    public Date date;
    //星期
    @SerializedName("week")
    public String week;

    protected DailyWeather(Parcel in) {
        textDay = in.readString();
        codeDay = in.readString();
        textNight = in.readString();
        codeNight = in.readString();
        high = in.readInt();
        low = in.readInt();
        wcDay = in.readString();
        wdDay = in.readString();
        wcNight = in.readString();
        wdNight = in.readString();
        waDay = in.readString();
        waNight = in.readString();
        wsDay = in.readString();
        wsNight = in.readString();
        pop = in.readInt();
        pressure = in.readInt();
        maxRh = in.readInt();
        minRh = in.readInt();
        vis = in.readInt();
        cloudsDay = in.readInt();
        cloudsNight = in.readInt();
        uv = in.readInt();
        week = in.readString();
        date = new Date(in.readLong());
    }

    public static final Creator<DailyWeather> CREATOR = new Creator<DailyWeather>() {
        @Override
        public DailyWeather createFromParcel(Parcel in) {
            return new DailyWeather(in);
        }

        @Override
        public DailyWeather[] newArray(int size) {
            return new DailyWeather[size];
        }
    };

    @Override
    public String toString() {
        return "DailyWeather{" +
                "text_day='" + textDay + '\'' +
                ", code_day='" + codeDay + '\'' +
                ", text_night='" + textNight + '\'' +
                ", code_night='" + codeNight + '\'' +
                ", high=" + high +
                ", low=" + low +
                ", wc_day='" + wcDay + '\'' +
                ", wd_day='" + wdDay + '\'' +
                ", wc_night='" + wcNight + '\'' +
                ", wd_night='" + wdNight + '\'' +
                ", wa_day='" + waDay + '\'' +
                ", wa_night='" + waNight + '\'' +
                ", ws_day='" + wsDay + '\'' +
                ", ws_night='" + wsNight + '\'' +
                ", pop=" + pop +
                ", pressure=" + pressure +
                ", max_rh=" + maxRh +
                ", min_rh=" + minRh +
                ", vis=" + vis +
                ", clouds_day=" + cloudsDay +
                ", clouds_night=" + cloudsNight +
                ", uv=" + uv +
                ", date=" + date +
                ", week='" + week + '\'' +
                '}';
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeString(textDay);
        dest.writeString(codeDay);
        dest.writeString(textNight);
        dest.writeString(codeNight);
        dest.writeInt(high);
        dest.writeInt(low);
        dest.writeString(wcDay);
        dest.writeString(wdDay);
        dest.writeString(wcNight);
        dest.writeString(wdNight);
        dest.writeString(waDay);
        dest.writeString(waNight);
        dest.writeString(wsDay);
        dest.writeString(wsNight);
        dest.writeInt(pop);
        dest.writeInt(pressure);
        dest.writeInt(maxRh);
        dest.writeInt(minRh);
        dest.writeInt(vis);
        dest.writeInt(cloudsDay);
        dest.writeInt(cloudsNight);
        dest.writeInt(uv);
        dest.writeString(week);
        dest.writeLong(date.getTime());
    }
}
